﻿using System.Windows;
using Xcj.Mes.Core.CustomControls;
using Xcj.Mes.WholeLine.Plc.Factory;

namespace Xcj.Mes.WholeLine.ZH.HG.Shell
{
    /// <summary>
    /// ShellWindow.xaml 的交互逻辑
    /// </summary>
    public partial class ShellWindow : Window
    {
        public ShellWindow()
        {
            InitializeComponent();
            
            this.Closing += new System.ComponentModel.CancelEventHandler((o, e) =>
            {
                if (ReportBox.ShowDialog($"提示：您确定要退出电容整线数据管理系统吗？", "提示",
                    MessageBoxButton.OKCancel, MessageBoxImage.Information) != MessageBoxResult.OK)
                {
                    PlcFactory.Dispose();
                    e.Cancel = true;
                }
            });
        }
    }
}
